﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using GranitePackageSystem.GranitePackagingService;

namespace GranitePackageSystem.Views.Request
{
    public partial class SourceFiles : Page
    {
        private int reqNumber;
        public SourceFiles()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void fileUploader_Loaded(object sender, RoutedEventArgs e)
        {
            this.fileUploader.Files.SingleFileUploadFinished += new EventHandler<FileUploader.FileUploadedEventArgs>(Files_SingleFileUploadFinished);
        }
        void Files_SingleFileUploadFinished(object sender, FileUploader.FileUploadedEventArgs e)
        {
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.processFileCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(proxy_processFileCompleted);
            proxy.processFileAsync(e.FileGuid, e.FileName, this.reqNumber.ToString());
        }

        void proxy_processFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {

        }
   }
}
